﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Runtime.Serialization;

namespace $safeprojectname$.Infrastructure.Exceptions
{
    [Serializable]
    public class ComplexException : BaseException
    {
        #region members
        string _message;

        readonly IDictionary _data = new SortedList<string, string>
                {
                    {"test1", "testvalue1"},
                    {"test2", "testvalue2"}
                };
        const string TestMessage = "To test the ExceptionStingBuilder";
        #endregion members

        #region constructor
        public ComplexException()
        {
            _data = null;
        }
        public ComplexException(string message)
            : base(message)
        {
            _message = message;
        }
        public ComplexException(string message, Exception ex) : base(message, ex) { }
        public ComplexException(SerializationInfo info, StreamingContext context) : base(info, context) { }
        #endregion constructor

        #region for tests
        public string BrokenMessage
        {
            private get { throw new NotImplementedException(); }
            set { _message = value; }
        }
        public override IDictionary Data
        {
            get { return _data; }
        }
        public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            base.GetObjectData(info, context);
        }
        #endregion for tests
    }
}
